home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
BARNET
/
FREENET
/
BRODIE
/
SOCK_ERR
< prev
Wrap
Text File
|
1995-05-01
|
3KB
|
66 lines
/*
* ArcWebTCP
*
* Copyright (C) Stewart Brodie, 1994, 1995
*
* This product is supplied under the terms laid down in the `Terms' file.
*
*
* This file: sock_errno.c
*
* THIS WILL BE IN A SWI - IT CAN BE LINKED STATICALLY FOR THE MOMENT THOUGH
*
*/
#include <stdio.h>
#include <errno.h>
#include "sock_errno.h"
#include "support.h"
char *socket_errno_to_string(void)
{
static char ueb[64];
switch (errno) {
case 0: return "No error";
default:
sprintf(ueb,"Unknown error (%d)", errno);
return ueb;
case EBADF : return "Bad descriptor";
case EAGAIN : return "No more ports";
case EFAULT : return "Bad address";
case EINVAL : return "Invalid argument";
case EWOULDBLOCK : return "Operation would block";
case EINPROGRESS : return "Operation now in progress";
case EALREADY : return "Operation already in progress";
case ENOTSOCK : return "Socket operation on non-socket";
case EDESTADDRREQ : return "Destination address required";
case EMSGSIZE : return "Message too long";
case EPROTOTYPE : return "Protocol wrong type for socket";
case ENOPROTOOPT : return "Protocol not available";
case EPROTONOSUPPORT : return "Protocol not supported";
case ESOCKTNOSUPPORT : return "Socket type not supported";
case EOPNOTSUPP : return "Operation not supported on socket";
case EPFNOSUPPORT : return "Protocol family not supported";
case EAFNOSUPPORT : return "Address family not supported by protocol family";
case EADDRINUSE : return "Address already in use";
case EADDRNOTAVAIL : return "Can't assign requested address";
case ENETDOWN : return "Network is down";
case ENETUNREACH : return "Network is unreachable";
case ENETRESET : return "Network dropped connection on reset";
case ECONNABORTED : return "Software caused connection abort";
case ECONNRESET : return "Connection reset by peer";
case ENOBUFS : return "No buffer space available";
case EISCONN : return "Socket is already connected";
case ENOTCONN : return "Socket is not connected";
case ESHUTDOWN : return "Can't send after socket shutdown";
case ETOOMANYREFS : return "Too many references: can't splice";
case ETIMEDOUT : return "Connection timed out";
case ECONNREFUSED : return "Connection refused";
case EHOSTDOWN : return "Host is down";
case EHOSTUNREACH : return "No route to host";
}
}